function throttle(fn, delay) {
    let pre = 0
    return function() {
        let time = Date.now()
        let arg = arguments
        if(time - pre >= delay) {
            fn.call(this, arg)
            pre = Date.now()
        }
    }
}